<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Order Confirmation</title>
<style type="text/css">
/* <![CDATA[ */
table, td
{
    border-color: #666;
    border-style: solid;
}
table, th
{
    border-color: #666;
    border-style: solid;
}

table
{
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
}
 
td
{
    margin: 0;
    padding: 4px;
    border-width: 1px 1px 0 0;
}
th
{
    margin: 0;
    padding: 4px;
    border-width: 1px 1px 0 0;
}
/* ]]> */


</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>

</head>
<body  style="font-family:Arial, Helvetica, sans-serif">
<h1>Stock Take History :</h1>
<h3><?php echo $this->orderDate1?></h3>
<br />
<table width="1050" border="0" cellspacing="1" cellpadding="0">

    <tr>
    <th >No.</th>
    <th >Code</th>
    <th style="width:300px;" >Description</th>
    <th style="width:100px;" >System</th>
    <th style="width:200px;" >Actual</th>
    <th style="width:100px;" >Difference</th>
    <th style="width:100px;" >SubTotal</th>
    </tr>
<?php 
	$rProduct = new Model_DbTable_Pr_Prproducts();
	$i = 1;
if(!empty($this->oList)){	
foreach($this->oList as $key => $v){
//2014-08-05 for only show screen parts		
$product = $rProduct->getProduct($v['id_product']);
	$actQty = $v['qty_onhand_cf'];
	$diff =  $actQty - $v['qty_onhand'];
	?> 
	<?php if($diff != 0){?>
  <tr 
 <?php
 
 	
	 
	
	if($diff == 0){
			echo 'style="background-color:#00FF00;"';		
	}
	if($diff!=0 && $actQty !=0){
		
		echo 'style="background-color:#FFFF00;"';	
	}
	if($diff!=0 && $actQty ==0){
		
		echo 'style="background-color:#FF8080;"';
		}	
 ?> 
 >	
 	<td><?php echo $i++;?></td>
    <td><?php echo $v['code_product']?></td>
    <td><span style="font-size:12px;"><?php echo $product['title_product']?></span></td>
    <td><?php echo $v['qty_onhand']?></td>
    <td align="center"><?php echo $v['qty_onhand_cf']?></td>
    <td><?php echo $diff;?></td>
    <td>&nbsp;</td>
  </tr>
 <?php }
	 }
	} ?> 
<?php 
if(!empty($this->oList)){	
foreach($this->oList as $key => $v){
//2014-08-05 for only show screen parts		
$product = $rProduct->getProduct($v['id_product']);
	$actQty = $v['qty_onhand_cf'];
	$diff =  $actQty - $v['qty_onhand'];
	?> 
	<?php if($diff == 0){?>
  <tr 
 <?php

	if($diff == 0){
			echo 'style="background-color:#00FF00;"';		
	}
	if($diff!=0 && $actQty !=0){
		
		echo 'style="background-color:#FFFF00;"';	
	}
	if($diff!=0 && $actQty ==0){
		
		echo 'style="background-color:#FF8080;"';
		}	
 ?> 
 >	
 	<td><?php echo $i++;?></td>
    <td><?php echo $v['code_product']?></td>
    <td><span style="font-size:12px;"><?php echo $product['title_product']?></span></td>
    <td><?php echo $v['qty_onhand']?></td>
    <td align="center"><?php echo $v['qty_onhand_cf']?></td>
    <td><?php echo $diff;?></td>
    <td>&nbsp;</td>
  </tr>
 <?php }
	 }
	} ?> 


</table>
<br/><br/>
<h3><?php echo $this->orderDate2?></h3>
<br />
<table width="1050" border="0" cellspacing="1" cellpadding="0">

    <tr>
    <th >No.</th>
    <th >Code</th>
    <th style="width:300px;" >Description</th>
    <th style="width:100px;" >System</th>
    <th style="width:200px;" >Actual</th>
    <th style="width:100px;" >Difference</th>
    <th style="width:100px;" >SubTotal</th>
    </tr>
<?php 
	$rProduct = new Model_DbTable_Pr_Prproducts();
	$i = 1;
if(!empty($this->oList2)){	
foreach($this->oList2 as $key => $v){
//2014-08-05 for only show screen parts		
$product = $rProduct->getProduct($v['id_product']);
	$actQty = $v['qty_onhand_cf'];
	$diff =  $actQty - $v['qty_onhand'];
	?> 
	<?php if($diff != 0){?>
  <tr 
 <?php
 
 	
	 
	
	if($diff == 0){
			echo 'style="background-color:#00FF00;"';		
	}
	if($diff!=0 && $actQty !=0){
		
		echo 'style="background-color:#FFFF00;"';	
	}
	if($diff!=0 && $actQty ==0){
		
		echo 'style="background-color:#FF8080;"';
		}	
 ?> 
 >	
 	<td><?php echo $i++;?></td>
    <td><?php echo $v['code_product']?></td>
    <td><span style="font-size:12px;"><?php echo $product['title_product']?></span></td>
    <td><?php echo $v['qty_onhand']?></td>
    <td align="center"><?php echo $v['qty_onhand_cf']?></td>
    <td><?php echo $diff;?></td>
    <td>&nbsp;</td>
  </tr>
 <?php }
	 }
	} ?> 
<?php 
if(!empty($this->oList2)){	
foreach($this->oList2 as $key => $v){
//2014-08-05 for only show screen parts		
$product = $rProduct->getProduct($v['id_product']);
	$actQty = $v['qty_onhand_cf'];
	$diff =  $actQty - $v['qty_onhand'];
	?> 
	<?php if($diff == 0){?>
  <tr 
 <?php

	if($diff == 0){
			echo 'style="background-color:#00FF00;"';		
	}
	if($diff!=0 && $actQty !=0){
		
		echo 'style="background-color:#FFFF00;"';	
	}
	if($diff!=0 && $actQty ==0){
		
		echo 'style="background-color:#FF8080;"';
		}	
 ?> 
 >	
 	<td><?php echo $i++;?></td>
    <td><?php echo $v['code_product']?></td>
    <td><span style="font-size:12px;"><?php echo $product['title_product']?></span></td>
    <td><?php echo $v['qty_onhand']?></td>
    <td align="center"><?php echo $v['qty_onhand_cf']?></td>
    <td><?php echo $diff;?></td>
    <td>&nbsp;</td>
  </tr>
 <?php }
	 }
	} ?> 


</table>

</body>

</html>
